﻿using MySql.Data.MySqlClient;


namespace Development.DbData
{
    /// <summary>
    /// mysql 提供者
    /// </summary>
    public class DbMySqlProvider : DbProvider
    {
        public DbMySqlProvider(string connectionString)
            : base(connectionString)
        {

        }
        protected override System.Data.Common.DbCommand CreateCommand(string sql)
        {
            return new MySqlCommand(sql, (MySqlConnection)m_conn);
        }

        public override System.Data.Common.DbParameter CreateParameter(string paramName, int paramType, object paramValue)
        {
            MySqlParameter param = new MySqlParameter();
            param.MySqlDbType = (MySqlDbType)paramType;
            param.ParameterName = paramName;
            param.Value = paramValue;
            return param;
        }

        protected override System.Data.Common.DbConnection CreateConnection(string connString)
        {
            return new MySqlConnection(connString);
        }
    }
}
